from pydantic import BaseModel
from typing import Optional

# 微信登录请求
class WechatLogin(BaseModel):
    code: str

# 管理员登录请求
class AdminLogin(BaseModel):
    username: str
    password: str

# 用户基本信息响应
class UserBase(BaseModel):
    nickname: Optional[str] = None
    avatar: Optional[str] = None

class UserResponse(UserBase):
    id: int
    
    class Config:
        from_attributes = True

# 管理员基本信息响应
class AdminBase(BaseModel):
    username: str
    display_name: Optional[str] = None
    avatar: Optional[str] = None
    permission: int

class AdminResponse(AdminBase):
    id: int
    
    class Config:
        from_attributes = True

# 令牌响应
class Token(BaseModel):
    access_token: str
    token_type: str = "bearer" 